#!/bin/sh

uci -q batch <<-EOF >/dev/null
	delete ucitrack.@vlmcsd[-1]
	add ucitrack vlmcsd
	set ucitrack.@vlmcsd[-1].init=kms
	commit ucitrack
EOF

uci delete firewall.kms
uci add firewall rule 
uci rename firewall.@rule[-1]="kms"
uci set firewall.@rule[-1].name="kms"
uci set firewall.@rule[-1].target="ACCEPT"
uci set firewall.@rule[-1].src="wan"
uci set firewall.@rule[-1].proto="tcp"
uci set firewall.@rule[-1].dest_port="1688"
uci commit firewall

rm -f /tmp/luci-indexcache
exit 0
